var express = require('express');
var router = express.Router();
const {userInfo,userRegister,userLogin,userPass,getUser,remUser} = require('../controller/user')
const {checkToken} = require('../utils/utils')
// 获取用户信息
router.get('/api/user/:id',checkToken,userInfo)
//修改用户密码
router.put('/api/pass/:id',checkToken,userPass)
//注册
router.post('/api/register',userRegister)
//登录
router.post('/api/login',userLogin)
//后台获取用户信息列表
router.get('/api/admin/list',getUser);
//后台删除用户信息
router.post('/api/admin/remuser',remUser)
module.exports = router;
